package fr.cie.blog.beans;

import java.sql.Date;

/**
 * The super class which defines any kind of publication which means
 * {@link Article}, {@link Comment}...
 * 
 * @author AetM
 * 
 */
public abstract class Publication extends AbstractModel {

	/**
	 * Author of the Publication.
	 */
	private User author;
	/**
	 * publicationDate.
	 */
	private Date publicationDate;
	/**
	 * content.
	 */
	private String content;
	/**
	 * publication status.
	 */
	private boolean published;

	/**
	 * @return the author
	 */
	public final User getAuthor() {
		return author;
	}

	/**
	 * @return the content
	 */
	public final String getContent() {
		return this.content;
	}

	/**
	 * @return the publicationDate
	 */
	public final Date getPublicationDate() {
		return this.publicationDate;
	}

	/**
	 * @return true if the Publication is published, false otherwise
	 */
	public final boolean isPublished() {
		return this.published;
	}

	/**
	 * @param pAuthor
	 *            the author to set
	 */
	public final void setAuthor(final User pAuthor) {
		author = pAuthor;
	}

	/**
	 * @param newContent
	 *            the content to set
	 */
	public final void setContent(final String newContent) {
		this.content = newContent;
	}

	/**
	 * @param newPubDate
	 *            the publicationDate to set
	 */
	public final void setPublicationDate(final Date newPubDate) {
		this.publicationDate = newPubDate;
	}

	/**
	 * @param newStatus
	 *            the published to set
	 */
	public final void setPublished(final boolean newStatus) {
		this.published = newStatus;
	}
}